<?php /* УТФ-8:fix */

class SPIcore__lang
{
    private $default_lang_id = null;
    private $subviews_objects = array();

    public function set_default( $lang_id )
    {
        $this->default_lang_id = $lang_id;
    }

    public function get_lang()
    {
        return $this->default_lang_id;
    }
	
    public function __get( $varname )
    {
        $classname = "SPIlang__{$this->default_lang_id}__{$varname}";

        if( is_object( $this->subviews_objects[$classname] ) === false )
        {
            if( class_exists( $classname ) === false )
            {
                return null;
            }

            $this->subviews_objects[$classname] = new $classname;
        }

        return $this->subviews_objects[$classname];
    }
}
